# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=realtime-privileges
pkgver=4
pkgrel=2
pkgdesc="Realtime privileges for users"
arch=(any)
url="https://wiki.archlinux.org/index.php/Realtime_process_management"
license=(GPL3)
groups=(
  pro-audio
  realtime
)
install=$pkgname.install
changelog=ChangeLog
source=(
  99-$pkgname.conf
  sysusers-$pkgname.conf
  40-$pkgname.rules
  ChangeLog
)
sha512sums=('10bba7242c27850287aeea5084ab54e6e71343672f611a047266bded0e3e0ab8d7cfb0eb3bc3e39c3625b0e49520605b038b640c342247a28f09c5c850182183'
            '2f4d048a3e3c6de75bb7432092e1943143507110ff33aa9f7f2ca4ed3f028536c8f910735f5218f0fa6cc89e8eae70699bcce18c0dadc07e518fc3cf33611518'
            '349b432f17f3b5ee061d21eddb75f5b424c5eca913053a68f4f959a418fc5dca9198b7cc9141869540ec8f6f1fa928452fca9993c8f2200c8fbda2b65a25f0ad'
            'f66f92d4fe04743401d9f37bfd2a54393a0e66d24b82e05263842a68d9ef43691737898eb78ce6ab33dc78743b6143e140431230bc42ae02f80f5d34ac485d32')
b2sums=('ba49871609d0b8230be942a65d2c90277c1d6f398a3d6abc7a60a6f4e3141c3f9803608fd4af82368a5386ea3c7c233b7f5d36cc76999be62ba4c21381df8ddd'
        '9a0c97a880ee034116e88dca34254505fc8599f85ad4228b2afc8812aba76ef17ff1f464ea93326972b6f603594ec758ea0aa011c2be388ebe94ebcf039cbf74'
        '20dd3aa81d2c940b08091fc46199e98b8d5362e4b802ff1ce90f3d20554e9ad1c270228044407d5444ecbad960e9c8de29ff1ff7fe5652d875e8b1210a3db182'
        '7d4814748e92ffb74dc87c7839531b7d5e68fd7f0c9eb6abee25d23e4a4903fe9838082fefa55dcce51242c2b7437dc7290ceebe18ef7ef7cf42c886265fa444')

package() {
  # realtime group installed through sysusers.d
  install -vDm 644 sysusers-$pkgname.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
  # limits for realtime group
  install -vDm 644 99-$pkgname.conf -t "$pkgdir/etc/security/limits.d/"
  # udev rules, giving access to devices for realtime group
  install -vDm 644 40-$pkgname.rules -t "$pkgdir/usr/lib/udev/rules.d/"
  install -vDm 644 ChangeLog -t "$pkgdir/usr/share/doc/$pkgname/"
}
